module sm(
        input clk,
        input sm_en,
        output reg sm
    );
initial sm=0;
//clock in negedge touched off
always@(negedge clk) 
begin
    //negedge:signal-turn over
    if(sm_en) sm <= !sm;  
    else sm <= sm;
end
endmodule  
      